<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>simvoc.core.input_manager.FlexInput</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="simvoc-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >SimVOC</th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="simvoc-module.html">Package&nbsp;simvoc</a> ::
        <a href="simvoc.core-module.html">Package&nbsp;core</a> ::
        <a href="simvoc.core.input_manager-module.html">Module&nbsp;input_manager</a> ::
        Class&nbsp;FlexInput
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class FlexInput</h1><p class="nomargin-top"><span class="codelink"><a href="simvoc.core.input_manager-pysrc.html#FlexInput">source&nbsp;code</a></span></p>
<center>
<center>  <map id="uml_class_diagram_for_simvoc_c_14" name="uml_class_diagram_for_simvoc_c_14">
<area shape="rect" id="node27" href="simvoc.core.input_manager.FlexInput-class.html#__init__" title="x.__init__(...) initializes x; see x.__class__.__doc__ for signature" alt="" coords="17,39,288,57"/>
<area shape="rect" id="node27" href="simvoc.core.input_manager.FlexInput-class.html#add_reader" title="simvoc.core.input_manager.FlexInput.add_reader" alt="" coords="17,57,288,76"/>
<area shape="rect" id="node27" href="simvoc.core.input_manager.FlexInput-class.html#open_file" title="Opens a single file and adds its handle to the list of open handles" alt="" coords="17,76,288,95"/>
<area shape="rect" id="node27" href="simvoc.core.input_manager.FlexInput-class.html#init_reader" title="Initializes a reader object on the given file, using the specified profile." alt="" coords="17,95,288,113"/>
<area shape="rect" id="node27" href="simvoc.core.input_manager.FlexInput-class.html#load" title="Loads a single text file or a set of several text files contained in a &#160;directory or tar archive (using an optional matching extension)." alt="" coords="17,113,288,132"/>
<area shape="rect" id="node27" href="simvoc.core.input_manager.FlexInput-class.html#close" title="Closes all open file handles." alt="" coords="17,132,288,151"/>
<area shape="rect" id="node27" href="simvoc.core.input_manager.FlexInput-class.html#normalize" title="Performs a simulation&#45;time normalization of all open readers." alt="" coords="17,151,288,169"/>
<area shape="rect" id="node1" href="simvoc.core.input_manager.FlexInput-class.html" title="Flexible input handler class." alt="" coords="5,6,299,175"/>
</map>
  <img src="uml_class_diagram_for_simvoc_c_14.gif" alt='' usemap="#uml_class_diagram_for_simvoc_c_14" ismap="ismap" class="graph-without-title" />
</center>
</center>
<hr />
<p>Flexible input handler class. This class handles input files in plain 
  text formats, nested directory hierarchies containing input files, and 
  tar archives (which may contain nested directories) containing input 
  files. Actual input file processing is performed by a reader object, 
  which instances of this class produce by specifying a named profile for 
  each type of reader.</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.input_manager.FlexInput-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">simobj</span>)</span><br />
      x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.input_manager-pysrc.html#FlexInput.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.input_manager.FlexInput-class.html#add_reader" class="summary-sig-name">add_reader</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">profile</span>,
        <span class="summary-sig-arg">reader_class</span>,
        <span class="summary-sig-arg">**kwds</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.input_manager-pysrc.html#FlexInput.add_reader">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.input_manager.FlexInput-class.html#open_file" class="summary-sig-name">open_file</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">filename</span>)</span><br />
      Opens a single file and adds its handle to the list of open handles</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.input_manager-pysrc.html#FlexInput.open_file">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.input_manager.FlexInput-class.html#init_reader" class="summary-sig-name">init_reader</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">filename</span>,
        <span class="summary-sig-arg">fh</span>,
        <span class="summary-sig-arg">profile</span>)</span><br />
      Initializes a reader object on the given file, using the specified 
      profile.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.input_manager-pysrc.html#FlexInput.init_reader">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.input_manager.FlexInput-class.html#load" class="summary-sig-name">load</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">path</span>,
        <span class="summary-sig-arg">profile</span>,
        <span class="summary-sig-arg">extension</span>=<span class="summary-sig-default">None</span>)</span><br />
      Loads a single text file or a set of several text files contained in 
      a directory or tar archive (using an optional matching extension).</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.input_manager-pysrc.html#FlexInput.load">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.input_manager.FlexInput-class.html#close" class="summary-sig-name">close</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Closes all open file handles.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.input_manager-pysrc.html#FlexInput.close">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.input_manager.FlexInput-class.html#normalize" class="summary-sig-name">normalize</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Performs a simulation-time normalization of all open readers.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.input_manager-pysrc.html#FlexInput.normalize">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__repr__</code>,
      <code>__setattr__</code>,
      <code>__sizeof__</code>,
      <code>__str__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Properties</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Properties"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">simobj</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.input_manager-pysrc.html#FlexInput.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>x.__init__(...) initializes x; see x.__class__.__doc__ for 
  signature</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>simobj</code></strong> - Reference to the simulator object</li>
    </ul></dd>
    <dt>Overrides:
        object.__init__
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="add_reader"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">add_reader</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">profile</span>,
        <span class="sig-arg">reader_class</span>,
        <span class="sig-arg">**kwds</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.input_manager-pysrc.html#FlexInput.add_reader">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>profile</code></strong> (str) - Profile name for the new reader type</li>
        <li><strong class="pname"><code>reader_class</code></strong> - Class (CommonReader child) to instantiate when creating a new 
          reader</li>
        <li><strong class="pname"><code>kwds</code></strong> - Keyword arguments to pass to the reader class upon instantiation</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="open_file"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">open_file</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">filename</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.input_manager-pysrc.html#FlexInput.open_file">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Opens a single file and adds its handle to the list of open 
  handles</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>filename</code></strong> (str) - Name of the file to open</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>open file handle (r mode)</dd>
  </dl>
</td></tr></table>
</div>
<a name="init_reader"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">init_reader</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">filename</span>,
        <span class="sig-arg">fh</span>,
        <span class="sig-arg">profile</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.input_manager-pysrc.html#FlexInput.init_reader">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Initializes a reader object on the given file, using the specified 
  profile. The new reader object is added to the list of open readers for 
  later normalization (if desired).</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>filename</code></strong> (str) - Name of the open file</li>
        <li><strong class="pname"><code>fh</code></strong> - Handle to the open file (r mode)</li>
        <li><strong class="pname"><code>profile</code></strong> (str) - Name of the reader profile. An Exception will occur if this 
          profile name is not found in the FlexInput instance.</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>newly created reader object</dd>
  </dl>
</td></tr></table>
</div>
<a name="load"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">load</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">path</span>,
        <span class="sig-arg">profile</span>,
        <span class="sig-arg">extension</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.input_manager-pysrc.html#FlexInput.load">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Loads a single text file or a set of several text files contained in a
  directory or tar archive (using an optional matching extension).</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>path</code></strong> (str) - Path to open for input. May be a single text file, a tar archive,
          or a directory tree containing text files.</li>
        <li><strong class="pname"><code>profile</code></strong> (str) - Profile name used to select which reader class will be 
          instantiated</li>
        <li><strong class="pname"><code>extension</code></strong> (str) - File extension for filename testing (uses endswith, 
          case-sensitive) when the path references a tarfile or directory. 
          Only files matching the extension will be loaded. If extension is
          None, then all files in the given path will be loaded. This 
          option has no effect if path references a single text file.</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>list of reader objects</dd>
  </dl>
</td></tr></table>
</div>
<a name="close"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">close</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.input_manager-pysrc.html#FlexInput.close">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Closes all open file handles. Errors will occur if this method is 
  called before the simulation ends.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="normalize"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">normalize</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.input_manager-pysrc.html#FlexInput.normalize">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Performs a simulation-time normalization of all open readers. No 
  additional readers should be opened after the normalization is completed,
  and normalization should occur before starting the simulator.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="simvoc-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >SimVOC</th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0 on Fri Oct 23 11:04:30 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
